{%load static%}
<!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}" >
    <link rel="stylesheet" href="{% static 'css/base.css' %}" >
    <title>{% block title %}首页{% endblock%} - typeidea博客系统</title>
  </head>
  <body>
    <div class="container head">
        <nav class="navbar navbar-expand-lg navbar-light bg-light">
            <a href="#" class="navbar-brand">首页</a>
            <div class="collapse navbar-collapse" id="navbarSupportedContent">
                <ul class="navbar-nav mr-auto">
                     {% for cate in navs %}
                      <li class="nav-item"><a class='nav-link' href="{% url 'category-list' cate.id %}">{{cate.name}}</a></li>
                    {% endfor %}
                </ul>
            </div>
            <form action="#" method="GET" class="form-inline my-2 my-lg-0">
                <input type="search" class="form-control mr-sm-2" placeholder="Search" aria-label="Search">
                <button class="btn btn-outline-success" type='submit'>搜索</button>
            </form>
        </nav>
        <div class="jumbotron">
            <h1 class="display-4">Typeidea</h1>
            <p class="lead">基于Django的多人博客系统</p>
        </div>
    </div>
    <div class="container main">
        <div class="row">
            <div class="col-9 post-list">
                {% block main %}{% endblock%}
            </div>
            <div class="col-3">
                <div class="card sidebar">
                    {% for sidebar in sidebars %}                    
                    <div class="card-body">
                        <h4 class="card-title">{{sidebar.title}}</h4>
                        <p>{{sidebar.content_html}}</p>
                    </div>
                    {% endfor %}
                </div>

            </div>
        </div>
    </div>
    <footer class="footer">
        <div class="container">
            <hr>
            <nav class="nav categroy">
                {% for cate in categories %}
                <a href="{% url 'category-list' cate.id %}" class="nav-link">{{cate.name}}</a>
                {% endfor %}
            </nav>
        </div>
        <div class="container power"><span class="text-muted">Power by Typeidea@django</span></div>
    </footer>
    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
    <script src="https://cdn.bootcss.com/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
    <script src="{% static 'js/bootstrap.min.js'%}"></script>
</body>

</html>